package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;

<#if cfg.pfyPlugin_batch>
import java.util.List;
</#if>

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

<#if cfg.pfyPlugin_selective>
    //根据选择的属性进行插入
    @Override
    public int insertSelective(${entity} record, ${entity}.Column ... selective){
        return baseMapper.insertSelective(record, selective);
    }

    //根据选择的属性对主键对应的数据进行修改
    @Override
    public int updateByPrimaryKeySelective(${entity} record, ${entity}.Column ... selective){
        return baseMapper.updateByPrimaryKeySelective(record, selective);
    }

</#if>
<#if cfg.pfyPlugin_batch>
    //批量插入记录
    @Override
    public int batchInsert(List<${entity}> list){
        return baseMapper.batchInsert(list);
    }

    //批量插入记录
    @Override
    public int batchUpsert(List<${entity}> list){
        return baseMapper.batchUpsert(list);
    }

</#if>
}
</#if>
